﻿package mortal.game.view.guildNew.data
{
    import com.mui.controls.*;
    import flash.display.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.view.mainUI.Navbar.*;

    public class ShineBtnManager extends Object
    {
        private var _map:Object;
        private var _statusObj:Object;
        private static var _instance:ShineBtnManager;

        public function ShineBtnManager()
        {
            this._map = {};
            this._statusObj = {};
            return;
        }// end function

        public function register(param1:String, param2:DisplayObject) : void
        {
            if (param2 == null)
            {
                return;
            }
            if (this._map[param1] == null)
            {
                this._map[param1] = [];
            }
            var _loc_3:* = this._map[param1];
            if (_loc_3.indexOf(param2) == -1)
            {
                _loc_3.push(param2);
                if (this._statusObj[param1] != null && this._statusObj[param1] == true)
                {
                    param2.visible = true;
                    EffectManager.glowFilterReg(param2);
                }
            }
            return;
        }// end function

        public function unRegister(param1:String, param2:DisplayObject) : void
        {
            if (param2 == null || this._map[param1] == null)
            {
                return;
            }
            var _loc_3:* = this._map[param1];
            var _loc_4:* = _loc_3.indexOf(param2);
            if (_loc_4 != -1)
            {
                _loc_3.splice(_loc_4, 1);
            }
            EffectManager.glowFilterUnReg(param2);
            return;
        }// end function

        public function unShineNotRemove(param1:DisplayObject) : void
        {
            if (param1 == null)
            {
                return;
            }
            EffectManager.glowFilterUnReg(param1);
            return;
        }// end function

        public function shineBtn(param1:String, param2:Boolean) : void
        {
            var _loc_5:DisplayObject = null;
            if (this._map[param1] == null)
            {
                return;
            }
            var _loc_3:* = this._map[param1];
            this._statusObj[param1] = param2;
            var _loc_4:int = 0;
            while (_loc_4 < _loc_3.length)
            {
                
                _loc_5 = _loc_3[_loc_4];
                if (param2)
                {
                    EffectManager.glowFilterReg(_loc_5);
                }
                else
                {
                    EffectManager.glowFilterUnReg(_loc_5);
                }
                _loc_4++;
            }
            return;
        }// end function

        public function getMainBtn(param1:String) : GLoadedButton
        {
            var _loc_2:* = GameController.navbar.view as NavbarModule;
            return _loc_2.btnBottomContainer.getChildByName(param1) as GLoadedButton;
        }// end function

        public static function get instance() : ShineBtnManager
        {
            if (_instance == null)
            {
                _instance = new ShineBtnManager;
            }
            return _instance;
        }// end function

    }
}
